package com.srolorz.fmtp.thread.pool.executor.factory;


import com.srolorz.fmtp.thread.pool.executor.pool.ThreadPoolManageEntity;
import com.srolorz.fmtp.thread.pool.executor.pool.ThreadPoolManageExecutor;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author eleven
 */
public class ThreadPoolFactory {
    private static final ThreadPoolManageExecutor threadPoolManageExecutor = ThreadPoolManageExecutor.getNewInstance();

    public static ThreadPoolExecutor getThreadExecutor(String threadPoolName) {
        return threadPoolManageExecutor.getThreadPoolExecutor(threadPoolName);
    }

    public static void addThreadPool(ThreadPoolManageEntity entity) {
        threadPoolManageExecutor.addThreadPool(entity);
    }
}
